{extend name='common/common_layout'/}
{block name='source'}
    <meta name="keywords" content="{$kw}">
    <meta name="description" content="{$desc}">
    <link rel="stylesheet" href="__HOME__/css/index.css">
    <script src="__HOME__/js/index.js"></script>
{/block}
{block name='title'}
    首页
{/block}



{block name='center'}
    <!-- banner redirect_url img_url -->
    <header class="carousel">
        <div class="box">
            {foreach $banner as $b}
                <img src="{$b.img_url}" alt="{$b.img_url}">
            {/foreach}
        </div>
        <div class="buttons">
            {foreach $banner as $index => $b}
                {if $index == 0}
                <div class="active" i='{$index}'></div>
                {else}
                <div i='{$index}'></div>
                {/if}
            {/foreach}
        </div>
        <div class="left">
            <div class="arrow" style="background-image: url(__IMAGE__/home/index/banner-left.png);"></div>
        </div>
        <div class="right">
            <div class="arrow" style="background-image: url(__IMAGE__/home/index/banner-right.png);"></div>
        </div>
    </header>
    <!-- END -->

    <!-- 供求 -->
    <div class="supply-demand-container">
        <div class="supply">
            <div class="supply-demand-title">
                <span>最新供货</span>
                <div class="supply-demand-title-more">
                    <a href="/sd.html">
                        <span>更多 &gt;</span>
                    </a>
                </div>
            </div>

            <div class="supply-content">
                {foreach $supply as $item}
                <div class="supply-item">
                    <div class="supply-item-img" style="background-image: url('{$item.thumb}');"></div>
                    <div class="supply-item-title">
                        <span class="supply-item-title-main">{$item.name}</span>
                        <div>
                            <span style="display: inline-block;font-size: 0.5em;color: #999;border-right: 1px solid #999; padding-right: 5px;margin: 0;">{$item.type}</span>
                            <span style="display: inline-block;font-size: 0.5em;color: #999;">{$item.add_time}</span>
                        </div>
                    </div>
                    <div class="supply-item-price">
                        <span class="supply-item-price-num">
                            {$item.price}
                        </span>
                        <span class="supply-item-price-unit">
                            元/{$item.unit}
                        </span>
                    </div>
                    <div class="supply-item-btn">
                        <a href="/?{$item.hash}">
                            <span>查看详情</span>
                        </a>
                    </div>
                </div>
                {/foreach}
            </div>
        </div>
        <div class="demand">
            <div class="supply-demand-title">
                <span>最新求购</span>
                <div class="supply-demand-title-more">
                    <a href="/sd/demand.html">
                        <span>更多 &gt;</span>
                    </a>
                </div>
            </div>
            <div class="demand-content">
                {foreach $demand as $d}
                <div class="demand-item">
                    <div class="content">
                        <a href="/?{$d.hash_str}">
                            <span class="title">{$d.title}</span>
                        </a>
                        <div class="desc">
                            <span class="type">{$d.type}</span>
                            <span class="date">{$d.add_time}</span>
                        </div>
                    </div>
                </div>
                {/foreach}
            </div>
        </div>
    </div>
    <!-- END -->

    <!-- 最新文章 -->
    <div id="detail">
        <span class="detail-title">最新文章</span>
        <div style="display: flex;flex-direction: column;" id="articles">
            {foreach $article as $index => $item}
                {if $index < 5} 
                <div class="show-page-item">
                    <div class="item-img" style="background-image: url('{$item.image}');"></div>
                    <div class="item-desc">
                        <a href="/?{$item['hash_str']}">
                            <span class="title">{$item.title}</span>
                        </a>
                        <span class="desc">
                            {$item.summary}
                        </span>
                        <span class="date">
                            {$item.updatatime}
                        </span>
                    </div>
                </div>
                {else}
                <div class="show-page-item" style="display: none;opacity: 0; max-height: 0px; overflow: hidden;">
                    <div class="item-img" style="background-image: url('{$item.image}');"></div>
                    <div class="item-desc">
                        <a href="/?{$item['hash_str']}">
                            <span class="title">{$item.title}</span>
                        </a>
                        <span class="desc">
                            {$item.summary}
                        </span>
                        <span class="date">
                            {$item.updatatime}
                        </span>
                    </div>
                </div>
                {/if}
            {/foreach}
        </div>
         <!-- 查看更多按钮 -->
        <div style="width: 98%;text-align: center;margin: 20px 0 20px 0;">
            <button class="layui-btn layui-btn-primary more" style="margin: 0 auto;" onclick="getMore()">查看更多资讯</button>
        </div>
    </div>

{/block}


{block name='right'}
<div class="summary-graph-container">
    <div class="item"
        style="background-image: url('http://jr1test.oss-cn-beijing.aliyuncs.com/upload/202010/5f97ed6200215.gif');">
    </div>
    <div class="item"
        style="background-image: url('http://jr1test.oss-cn-beijing.aliyuncs.com/upload/202010/5f9a13296fa5d.gif');">
    </div>
    <div class="item"
        style="background-image: url('http://jr1test.oss-cn-beijing.aliyuncs.com/upload/202010/5f9a12e05e9e5.png');">
    </div>
</div>
{include file='common/common_last_news'/}
{/block}

